package com.fanjun.learning.multithread.Activity_Object_Pattern;



/**
 * 工厂类,用于返回主动对象类的实例
 */
public class ActivityObjectFactory {
    public static ActivityObject createActivityObject() {
        Servant servant = new Servant();
        ActivationQueue queue = new ActivationQueue();
        SchedulerThread scheduler = new SchedulerThread(queue);
        Proxy proxy = new Proxy(scheduler, servant);
        scheduler.start();
        return proxy;
    }
}
